﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using RFIDSystem.Controllers;
using RFIDSystem.IServices;
using RFIDSystem.Model;
using RFIDSystem.Model.Models;
using RFIDSystem.Services;

namespace RFIDSystem.Api.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    [Authorize(Permissions.Name)]
    public class ActivatorController : BaseApiController
    {
        private readonly IActivatorServices _activatorServices;

        public ActivatorController(IActivatorServices activatorServices)
        {
            _activatorServices = activatorServices;
        }
        [HttpGet]
        public async Task<MessageModel<List<Model.Models.Activator>>> GetActivators()
        {
            var rs = await _activatorServices.GetActivators();
            return new MessageModel<List<Model.Models.Activator>>()
            {
                msg = "获取成功！",
                response = rs
            };
        }
    }
}
